package main

func reverseInt(a []int) {
    for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
        a[i], a[j] = a[j], a[i]
    }
}

func solve( n int ,  m int ,  a []int ) []int {
    m %= n
    reverseInt(a)
    reverseInt(a[:m])
    reverseInt(a[m:])
    return a
}